#!/bin/bash -ex

echo 'Running AFL integration tests...'

if [ "$(cat /proc/sys/kernel/core_pattern)" != "core" ]; then
  echo 'AFL integration tests require sudo to modify your core_pattern.'
  sudo sh -c 'echo core > /proc/sys/kernel/core_pattern'
fi

AFL_INTEGRATION_TESTS=1 python butler.py py_unittest \
    -t core -p '*afl_launcher_integration*' "$@"
